1. Field of the Invention
The present invention generally relates to GPU application programming interfaces and more specifically to tessellating a patch using one or more shaders.
2. Description of the Related Art
In prior art for programmable tessellation interfaces such as DirectX 11, coordination amongst threads converting an input patch into a representation of the patch suitable for vertex evaluation over the patch's domain requires a high-level shader structured as the execution of a sequence of distinct program entry points. Such conversion of the input patch is performed when the high-level shader computes, using one or more threads, per-vertex and per-patch attributes for an output patch that is produced by the high-level shader's execution. The plurality of threads that are associated with the high-level shader execute independently and have no mechanism to communicate in order to coordination their computations. After all threads complete their execution of a program in the sequence, the subsequent high-level shader performs additional operations on the output patch to further compute attributes. Here, this subsequent high-level shader can read the outputs written by the prior shader execution described above, but cannot write or otherwise modify those inputs; it can only write its own per-thread outputs.
Expressing communication between multiple threads during this patch conversion process in separate shaders is cumbersome and less efficient than allowing coordinated communication among threads during a single shader execution. However coordinated communication requires mechanisms not present in the prior art. Well-known multi-threaded communication hazards such as read-modify-write hazards complicate coordination of threads. Conventional techniques such as locking for mutual exclusion are unavailable and not sufficiently efficient given the fast rate of tessellated patch processing within a graphics processor.
Accordingly, what is needed in the art is a technique for reliably synchronized coordination amongst threads when converting an input patch.